package part17;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * @author wcj
 * @Date 2021/6/1 22:26
 * @Version 1.0
 */
public class Part1717 {

    static List<String> list = Arrays.asList("one Two three Four five six one".split(" "));

    /**
     * Collections提供的工具方法
     *
     * @param args
     */
    public static void main(String[] args) {
        System.out.println("list disjoint:" + Collections.disjoint(list, Collections.singletonList("Four")));
        System.out.println(Collections.max(list));
        System.out.println(Collections.min(list));
        System.out.println(Collections.max(list, String.CASE_INSENSITIVE_ORDER));
        System.out.println(Collections.min(list, String.CASE_INSENSITIVE_ORDER));
        List<String> subList = Arrays.asList("Four five six".split(" "));
        System.out.println(Collections.indexOfSubList(list, subList));
        System.out.println(Collections.lastIndexOfSubList(list, subList));
        Collections.replaceAll(list, "one", "Yo");
        System.out.println(list);
        Collections.reverse(list);
        System.out.println(list);
        Collections.rotate(list, 3);
        System.out.println(list);
        List<String> source = Arrays.asList("in the matrix".split(" "));
        Collections.copy(list, source);

    }
}
